home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / m2posx10.zoo / m2posix.10 / src / ansic.dpp next >
Encoding:
Modula Definition  |  1993-10-06  |  6.3 KB  |  181 lines

  1. DEFINITION MODULE ANSIC;
  2. __DEF_SWITCHES__
  3. #ifdef HM2
  4. #ifdef __LONG_WHOLE__
  5. (*$!i+: Modul muss mit $i- uebersetzt werden! *)
  6. (*$!w+: Modul muss mit $w- uebersetzt werden! *)
  7. #else
  8. (*$!i-: Modul muss mit $i+ uebersetzt werden! *)
  9. (*$!w-: Modul muss mit $w+ uebersetzt werden! *)
  10. #endif
  11. #endif
  12. #if no_reexport
  13. #  error *** compiler does not allow reexporting!
  14. #endif
  15. (****************************************************************************)
  16. (* Dieses Modul fasst alle ANSI-C-Bibliotheksfunktionen, aus den unterlie-  *)
  17. (* genden Modulen zusammen. Teilweise sind diese Funktionen ebenfalls       *)
  18. (* POSIX.1-Funktionen, werden aber ueblicherweise nur mit ``C'' in Verbin-  *)
  19. (* dung gebracht. Fuer Leute, die lieber aus einem einzigen Modulimportieren*)
  20. (* wollen, und deren Compiler den Reexport erlaubt.                         *)
  21. (* Fuer die Beschreibung der Funktionen sollten die entsprechenden Defini-  *)
  22. (* tionsmodule konsultiert werden.                                          *)
  23. (* -------------------------------------------------------------------------*)
  24. (* 01-Okt-93, Holger Kleinschmidt                                           *)
  25. (****************************************************************************)
  26. #if !ISO_proc_const
  27. FROM SYSTEM IMPORT ADDRESS;
  28. FROM PORTAB IMPORT UNSIGNEDLONG,SIGNEDLONG;
  29. #endif
  30. IMPORT types,cmdline,ctype,cstr,lib,MEMBLK;
  31.  
  32. (*===========================================================================*)
  33. (* Modul: 'types'                                                            *)
  34. (*===========================================================================*)
  35.  
  36. CONST
  37.   NULL = types.NULL;
  38.  
  39. TYPE
  40.   StrRange = types.StrRange;
  41.   StrPtr   = types.StrPtr;
  42.  
  43. TYPE
  44.   ArrayRange = types.ArrayRange;
  45.   StrArray   = types.StrArray;
  46.  
  47. (*===========================================================================*)
  48. (* Modul: 'ctype'                                                            *)
  49. (*===========================================================================*)
  50.  
  51. #if ISO_proc_const
  52. CONST
  53.   isalnum  = ctype.isalnum;
  54.   isalpha  = ctype.isalpha;
  55.   iscntrl  = ctype.iscntrl;
  56.   isdigit  = ctype.isdigit;
  57.   isgraph  = ctype.isgraph;
  58.   islower  = ctype.islower;
  59.   isprint  = ctype.isprint;
  60.   ispunct  = ctype.ispunct;
  61.   isspace  = ctype.isspace;
  62.   isupper  = ctype.isupper;
  63.   isxdigit = ctype.isxdigit;
  64.   tolower  = ctype.tolower;
  65.   toupper  = ctype.toupper;
  66. #else
  67. VAR (* READ ONLY! *)
  68.   isalnum  : PROCEDURE(CHAR):BOOLEAN;
  69.   isalpha  : PROCEDURE(CHAR):BOOLEAN;
  70.   iscntrl  : PROCEDURE(CHAR):BOOLEAN;
  71.   isdigit  : PROCEDURE(CHAR):BOOLEAN;
  72.   isgraph  : PROCEDURE(CHAR):BOOLEAN;
  73.   islower  : PROCEDURE(CHAR):BOOLEAN;
  74.   isprint  : PROCEDURE(CHAR):BOOLEAN;
  75.   ispunct  : PROCEDURE(CHAR):BOOLEAN;
  76.   isspace  : PROCEDURE(CHAR):BOOLEAN;
  77.   isupper  : PROCEDURE(CHAR):BOOLEAN;
  78.   isxdigit : PROCEDURE(CHAR):BOOLEAN;
  79.   tolower  : PROCEDURE(CHAR):CHAR;
  80.   toupper  : PROCEDURE(CHAR):CHAR;
  81. #endif
  82.  
  83. (*===========================================================================*)
  84. (* Modul: 'cstr'                                                             *)
  85. (*===========================================================================*)
  86.  
  87. #if ISO_proc_const
  88. CONST
  89.   strlen   = cstr.strlen;
  90.   strcpy   = cstr.strcpy;
  91.   strncpy  = cstr.strncpy;
  92.   strcat   = cstr.strcat;
  93.   strncat  = cstr.strncat;
  94.   strcmp   = cstr.strcmp;
  95.   strncmp  = cstr.strncmp;
  96.   strchr   = cstr.strchr;
  97.   strrchr  = cstr.strrchr;
  98.   strstr   = cstr.strstr;
  99.   strpbrk  = cstr.strpbrk;
  100.   strerror = cstr.strerror;
  101. #else
  102. VAR (* READ ONLY! *)
  103.   strlen   : PROCEDURE(StrPtr):types.sizeT;
  104.   strcpy   : PROCEDURE(StrPtr,StrPtr);
  105.   strncpy  : PROCEDURE(StrPtr,StrPtr,types.sizeT);
  106.   strcat   : PROCEDURE(StrPtr,StrPtr);
  107.   strncat  : PROCEDURE(StrPtr,StrPtr,types.sizeT);
  108.   strcmp   : PROCEDURE(StrPtr,StrPtr):INTEGER;
  109.   strncmp  : PROCEDURE(StrPtr,StrPtr,types.sizeT):INTEGER;
  110.   strchr   : PROCEDURE(StrPtr,CHAR):StrPtr;
  111.   strrchr  : PROCEDURE(StrPtr,CHAR):StrPtr;
  112.   strstr   : PROCEDURE(StrPtr,StrPtr):StrPtr;
  113.   strpbrk  : PROCEDURE(StrPtr,StrPtr):StrPtr;
  114.   strerror : PROCEDURE(INTEGER,VAR ARRAY OF CHAR);
  115. #endif
  116.  
  117. (*===========================================================================*)
  118. (* Modul: 'cmdline'                                                          *)
  119. (*===========================================================================*)
  120.  
  121. (* 'cmdline.environ' kann als Variable nicht reexportiert werden *)
  122. #if ISO_proc_const
  123. CONST
  124.   main   = cmdline.main;
  125.   getenv = cmdline.getenv;
  126. #else
  127. VAR (* READ ONLY! *)
  128.   main   : PROCEDURE(VAR ArrayRange,VAR StrArray);
  129.   getenv : PROCEDURE(REF ARRAY OF CHAR):StrPtr;
  130. #endif
  131.  
  132. (*===========================================================================*)
  133. (* Modul: 'lib'                                                              *)
  134. (*===========================================================================*)
  135.  
  136. CONST
  137.   RandMax = lib.RandMax;
  138.  
  139. TYPE
  140.   CompareProc = lib.CompareProc;
  141.  
  142. #if ISO_proc_const
  143. CONST
  144.   strtol   = lib.strtol;
  145.   strtoul  = lib.strtoul;
  146.   bsearch  = lib.bsearch;
  147.   qsort    = lib.qsort;
  148.   rand     = lib.rand;
  149.   srand    = lib.srand;
  150. #else
  151. VAR (* READ ONLY! *)
  152.   strtol   : PROCEDURE(REF ARRAY OF CHAR,VAR CARDINAL,CARDINAL):SIGNEDLONG;
  153.   strtoul  : PROCEDURE(REF ARRAY OF CHAR,VAR CARDINAL,CARDINAL):UNSIGNEDLONG;
  154.   bsearch  : PROCEDURE(ADDRESS,ADDRESS,UNSIGNEDLONG,UNSIGNEDLONG,CompareProc):ADDRESS;
  155.   qsort    : PROCEDURE(ADDRESS,UNSIGNEDLONG,UNSIGNEDLONG,CompareProc);
  156.   rand     : PROCEDURE():UNSIGNEDLONG;
  157.   srand    : PROCEDURE(UNSIGNEDLONG);
  158. #endif
  159.  
  160. (*===========================================================================*)
  161. (* Modul: 'MEMBLK'                                                           *)
  162. (*===========================================================================*)
  163.  
  164. #if ISO_proc_const
  165. CONST
  166.   memmove = MEMBLK.memmove;
  167.   memcpy  = MEMBLK.memmove; (* kein Schreibfehler *)
  168.   memset  = MEMBLK.memset;
  169.   memchr  = MEMBLK.memchr;
  170.   memcmp  = MEMBLK.memcmp;
  171. #else
  172. VAR (* READ ONLY! *)
  173.   memmove : PROCEDURE(ADDRESS,ADDRESS,UNSIGNEDLONG);
  174.   memcpy  : PROCEDURE(ADDRESS,ADDRESS,UNSIGNEDLONG);
  175.   memset  : PROCEDURE(ADDRESS,CARDINAL,UNSIGNEDLONG);
  176.   memchr  : PROCEDURE(ADDRESS,CARDINAL,UNSIGNEDLONG):ADDRESS;
  177.   memcmp  : PROCEDURE(ADDRESS,ADDRESS,UNSIGNEDLONG):INTEGER;
  178. #endif
  179.  
  180. END ANSIC.
  181.